<template>
  <div class="wrapper">
    <swiper :options="swiperOption" class="swiperimg" v-if="swiperShow">
      <swiper-slide v-for="item of swiperList" :key="item.id">
        <img :src="item.imgUrl" alt="">
      </swiper-slide>
      <div class="swiper-pagination"  slot="pagination"></div>
    </swiper>
  </div>
</template>

<script>
export default {
  name: 'HomeSwiper',
  props: {
    swiperList: Array
  },
  data: function () {
    return {
      swiperOption: {
        pagination: '.swiper-pagination',
        // autoplay: 3000,
        loop: true
      }
    }
  },
  computed: {
    swiperShow: function () {
      return this.swiperList.length
    }
  }
}
</script>

<style lang="stylus" scoped>
  .wrapper
    width: 100%
    height: 0
    overflow hidden
    padding-bottom 38.25%
    /*padding-bottom 31%*/
    .swiperimg img{
      width: 100%;
    }
</style>
